package cn.wolfcode.crm.domain;

import com.alibaba.fastjson.JSON;
import lombok.*;

import java.util.HashMap;

@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class Department {
    private Long id;

    private String name;

    private String sn;

    public String getJson() {
        //封装数据更加安全
        HashMap<Object, Object> map = new HashMap<>();
        map.put("id", id);
        map.put("name", name);
        map.put("sn", sn);
        return JSON.toJSONString(map);
    }


}